import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter);
const routes = [
	{
		path: '/admin',
		name: 'Login',
		meta:{
			title: '巡线后台管理-登录'
		},
		component: function () {
			return import('../components/Login.vue')
		}
	},
	{
		path: '/admin/dashboard',
		name: 'Dashboard',
		meta:{
			title: '巡线后台管理-主控台'
		},
		component: function () {
			return import('../components/Dashboard.vue')
		}
	},
	{
		path: '/admin/project',
		name: 'Project',
		meta:{
			title: '巡线后台管理-项目管理'
		},
		component: function () {
			return import('../components/Project.vue')
		}
	},
	{
		path: '/admin/user',
		name: 'User',
		meta:{
			title: '巡线后台管理-用户管理'
		},
		component: function () {
			return import('../components/User.vue')
		}
	},
	{
		path: '/admin/file',
		name: 'File',
		meta:{
			title: '巡线后台管理-文件管理'
		},
		component: function () {
			return import('../components/File.vue')
		}
	},
	{
		path: '/admin/flyTask',
		name: 'FlyTask',
		meta:{
			title: '巡线后台管理-飞行任务'
		},
		component: function () {
			return import('../components/FlyTask.vue')
		}
	},
	{
		path: '/admin/danger',
		name: 'Danger',
		meta:{
			title: '巡线后台管理-险情管理'
		},
		component: function () {
			return import('../components/Danger.vue')
		}
	},
	{
		path: '/admin/pipeline',
		name: 'Pipeline',
		meta:{
			title: '巡线后台管理-管线管理'
		},
		component: function () {
			return import('../components/Pipeline.vue')
		}
	},
	{
		path: '/admin/orthographicImage',
		name: 'OrthographicImage',
		meta:{
			title: '巡线后台管理-正射影像'
		},
		component: function () {
			return import('../components/OrthographicImage.vue')
		}
	},
	{
		path: '/admin/infrastructure',
		name: 'Infrastructure',
		meta:{
			title: '巡线后台管理-基础设施'
		},
		component: function () {
			return import('../components/Infrastructure.vue')
		}
	},
	{
		path: '/admin/infrastructureType',
		name: 'InfrastructureType',
		meta:{
			title: '巡线后台管理-类型管理'
		},
		component: function () {
			return import('../components/InfrastructureType.vue')
		}
	},
	{
		path: '/admin/client',
		name: 'Client',
		meta:{
			title: '巡线后台管理-客户端'
		},
		component: function () {
			return import('../components/Client.vue')
		}
	},{
		path: '/',
		name: '巡线后台管理-主控台',
		redirect: '/admin/dashboard'
	}
]

const router = new VueRouter({
	mode: 'hash',//hash history
	base: '/static/admin/',
	routes
});

export default router
